package com.kunya.product.controller.portall;


import com.kunya.common.common.ServerResponse;
import com.kunya.product.po.Navigation;
import com.kunya.product.service.INavigationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * @author cdy
 * @Description: 导航controller
 * @date 2018/7/14
 */
@RestController
@RequestMapping(value = "/navigation")
public class NavigationController {

    @Autowired
    private INavigationService iNavigationService;

    /**
     * 添加活动到导航栏
     * @param navigation
     * @return
     */
    @RequestMapping(value = "/add")
    public ServerResponse add(Navigation navigation){
       return iNavigationService.addNavigation(navigation);
    }

    /**
     * 显示隐藏导航栏
     * @param navigation
     * @return
     */
    @RequestMapping(value = "/updateStatus")
    public ServerResponse updateStatus(Navigation navigation){
        return iNavigationService.updateNavigation(navigation);
    }

    /**
     * 显示导航栏内的所有商品
     * @param navigationId
     * @return
     */
    @RequestMapping(value = "/showGoods")
    public ServerResponse showGoods(Long navigationId){
        return iNavigationService.showGoods(navigationId);
    }

    /**
     * 删除导航栏下的单个商品
     * @param navigationBarId
     * @return
     */
    @RequestMapping(value = "/deleteGoods")
    public ServerResponse deleteGoods(Long navigationBarId){
        return iNavigationService.deleteGoods(navigationBarId);
    }

    /**
     * 删除整个导航信息
     * @param navigationId
     * @return
     */
    @RequestMapping(value = "/deleteNavigation")
    public ServerResponse deleteNavigation(Long navigationId){
        return iNavigationService.deleteNavigation(navigationId);
    }
}
